unify(gamelogic): Merge GameLogicDispatch and related code and move most GameLogic System files to Core#2698
Conversation
|
| Filename | Overview |
|---|---|
| Core/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp | New Core file: unified merge of Generals + Zero Hour GameLogicDispatch, adds screen fade on score screen and MSG_ENABLE_RETALIATION_MODE handling; uses nullptr throughout; RETAIL_COMPATIBLE_CRC #ifdef paths are consistent with the message-posting side in GeneralsMD/Player.cpp. |
| Generals/Code/GameEngine/Include/Common/Player.h | Adds m_logicalRetaliationModeEnabled field and accessors; the header comment states Player::update() will post MSG_ENABLE_RETALIATION_MODE on change, but that posting code is absent from Generals/Player.cpp (it only exists in GeneralsMD/Player.cpp). |
| Generals/Code/GameEngine/Source/Common/RTS/Player.cpp | Initializes m_logicalRetaliationModeEnabled = FALSE in init(); constructor already calls init(nullptr), so no uninitialized-member risk; no serialization change needed since the field is re-derived from GlobalData each update. |
| Generals/Code/GameEngine/Include/Common/MessageStream.h | Adds MSG_ENABLE_RETALIATION_MODE enum value before the debug-network sentinel; enum value ordering is safe. |
| Core/GameEngine/CMakeLists.txt | Uncomments CaveSystem, CrateSystem, Damage, RankInfo headers and sources plus GameLogicDispatch and RankInfo source files to include them in the Core build. |
| Generals/Code/GameEngine/CMakeLists.txt | Comments out the same set of files now provided by Core, correctly mirroring the Core CMakeLists changes to avoid duplicate compilation units. |
| GeneralsMD/Code/GameEngine/CMakeLists.txt | Same as Generals CMakeLists — comments out files now provided by Core; symmetrical with Generals changes. |
| scripts/cpp/unify_move_files.py | Whitespace fix (trailing space removed) and adds commented-out entries tracking the files moved in this PR for future reference. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
subgraph Before
G1[Generals/GameLogicDispatch.cpp]
G2[Generals/CaveSystem.h+cpp]
G3[Generals/CrateSystem.h+cpp]
G4[Generals/Damage.h+cpp]
G5[Generals/RankInfo.h+cpp]
ZH1[GeneralsMD/GameLogicDispatch.cpp]
end
subgraph After
C1[Core/GameLogicDispatch.cpp\nMerged: Generals + ZH\n+ Screen Fade\n+ MSG_ENABLE_RETALIATION_MODE]
C2[Core/CaveSystem.h+cpp]
C3[Core/CrateSystem.h+cpp]
C4[Core/Damage.h+cpp]
C5[Core/RankInfo.h+cpp]
GPlayer[Generals/Player.h+cpp\n+ m_logicalRetaliationModeEnabled\n+ MSG_ENABLE_RETALIATION_MODE]
GMsgStream[Generals/MessageStream.h\n+ MSG_ENABLE_RETALIATION_MODE]
end
G1 -->|deleted, merged into| C1
ZH1 -->|merged into| C1
G2 -->|moved to| C2
G3 -->|moved to| C3
G4 -->|moved to| C4
G5 -->|moved to| C5
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
Generals/Code/GameEngine/Include/Common/Player.h:651-655
**Comment describes behavior absent in the Generals build**
The inline comment states that `Player::update()` detects a change in `TheGlobalData->m_clientRetaliationModeEnabled` and posts `MSG_ENABLE_RETALIATION_MODE`. That posting code exists in `GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp` but is **not** present in `Generals/Code/GameEngine/Source/Common/RTS/Player.cpp`. As a result, `m_logicalRetaliationModeEnabled` will always remain `FALSE` in the Generals build, and the comment will mislead future contributors who look here. Is this intentional scaffolding for a future port, or was the `Player::update()` posting block meant to be included in this PR?
Reviews (2): Last reviewed commit: "unify(gamelogic): Move most GameLogic Sy..." | Re-trigger Greptile
73ca23d to
0116c4c
Compare
Merge with Rebase
This change merges GameLogicDispatch and related code and moves most GameLogic System files to Core.
GameLogic.cpp was not moved because that still requires complicated merges.
Generals gets
TODO